package com.atguigu.gmall.common.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 *
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200,"成功"),
    FAIL(201, "失败"),
    SERVICE_ERROR(2012, "服务异常"),

    SKU_INFO_NOT_EXIST(204, "商品信息不存在"),
    SKU_INFO_CART_NOT_ZERO(2041, "商品数量不能小于0"),

    PAY_RUN(205, "支付中"),

    LOGIN_AUTH(208, "未登陆"),
    LOGIN_PASSWORD_USERNAME_NOT_EMPTY(320,"用户名或密码不能为空"),
    LOGIN_NOT_EXIST(321,"用户不存在"),


    PERMISSION(401, "没有权限"),
    SECKILL_NO_START(210, "秒杀还没开始"),
    SECKILL_RUN(211, "正在排队中"),
    SECKILL_NO_PAY_ORDER(212, "您有未支付的订单"),
    SECKILL_FINISH(213, "已售罄"),
    SECKILL_END(214, "秒杀已结束"),
    SECKILL_SUCCESS(215, "抢单成功"),
    SECKILL_FAIL(216, "抢单失败"),
    SECKILL_ILLEGAL(217, "请求不合法"),
    SECKILL_ORDER_SUCCESS(218, "下单成功"),
    COUPON_GET(220, "优惠券已经领取"),
    COUPON_LIMIT_GET(221, "优惠券已发放完毕"),
    CART_ITEM_SIZE_LIMIT(222 , "商品数量添加过多，限购5件哦！" ),
    CART_TOTAL_LIMIT(223,"购物车商品数量太多，先清空试试！" ),
    CART_TEMP_TOO_MUCH(224, "临时购物车商品数量过多，清理一些吧"),

    ORDER_MULTIPLE_SUBMIT(3001, "订单已提交，请勿重复提交"),
    ORDER_SKU_PRICE_CHANGE(3002,"商品价格发生变化，刷新重试！" ),
    ORDER_SKU_STOCK_CHANGE(3003,"商品没货了，请稍等店主备货哦！" );

    private Integer code;

    private String message;

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
